package linc.cool;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author yqlin
 * @date 2022/3/3 5:22 下午
 * @description
 */
public class Main {
    @Data
    @AllArgsConstructor
    static class A {
        private String name;
    }

    @Data
    @AllArgsConstructor
    static class B {
        private String name;
    }
    public static void main(String[] args) {
        List<A> a = Arrays.asList(new A("a"), new A("b"), new A("c"));
        List<B> b = a.stream().map(e -> new B(e.name)).collect(Collectors.toList());
        System.out.println(b);
    }
}
